package com.bjtu.literatureclient.util;

import com.bjtu.literatureclient.domain.user.User;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.Subject;

/**
 * @author caiyuli
 * @date 2020/4/25 11:59 上午
 */
public class UserUtil {


    public static User getCurUser() {
        Subject currentUser = SecurityUtils.getSubject();
        Session session = currentUser.getSession();
        User user = (User) session.getAttribute("userInfo");
        return user;
    }

}
